#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <set>
#include <map>
#include <cstdio>
#define fill(a, c) memset(a, c, sizeof(a))
#define ldb long double
#define LL long long
#define nextLine() {int c = 0; while((c = getchar()) != 10 && c != EOF);}
#define sqr(a) ((a) * (a))
#define debug(a) cerr << #a << " = " << a << " ";
#define debugl(a) cerr << #a << " = " << a << "\n";
const ldb eps = 1e-9;
const ldb LDINF = 1e70;
const LL LINF = 1ll << 60;
const int INF = 1 << 30;
const ldb pi = fabs(atan2(0.0, -1.0));
using namespace std;

int n, k;
int TSIZE;
int tree[1 << 17];
int add[1 << 17];
int b[2010];

void Load()
{
 	cin >> n >> k;
 	int i;
 	for (i = 0; i < n; i++)
 	{
 		scanf("%d", &b[i]);
 	}
}

void upd(int v)
{
		tree[v] += add[v];
		if (v < TSIZE)
		{
			add[v << 1] += add[v];
			add[(v << 1) | 1] += add[v];
		}
		add[v] = 0;
}


int Get(int v, int x, int L, int R)
{
	upd(v);
	if (x < L) return -1;
	if (v >= TSIZE)
	{
		return tree[v];
	}
	int t;
	if (x <= (L + R) / 2)
	{
		t = Get(v << 1, x, L, (L + R) / 2);
	}
	else 
	{
		t = Get((v << 1) | 1, x, (L + R) / 2 + 1, R);
	}
	tree[v] = min(tree[v], tree[v << 1]);
	return t;
}

int GetMin(int v, int l, int r, int L, int R)
{
	upd(v);
	if (r < L || R < l) return INF;
	if (l <= L && r >= R)
	{
		return tree[v];
	}
	return min(GetMin(v << 1, l, r, L ,  (L + R) / 2), GetMin((v << 1) | 1, l , r, (L + R) / 2 + 1, R));
}

void Add(int v, int x, int l, int r, int L, int R)
{
	upd(v);
	if (r < L || R < l) return;
	if (l <= L && r >= R)
	{
		add[v] += x;
		upd(v);
		return;
	}
	Add(v << 1, x, l, r, L ,  (L + R) / 2);
	Add((v << 1) | 1, x, l , r, (L + R) / 2 + 1, R);
	tree[v] = min(tree[v << 1], tree[(v << 1) | 1]);
}

void Solve()
{
	int i, j;
	TSIZE = 1;
	while (TSIZE < n) TSIZE <<= 1;

	for (i = 0; i < n; i++)
	{
		tree[TSIZE + i] = b[i];	
		add[TSIZE + i] = 0;
	}
	for (i = n; i < TSIZE; i++) tree[TSIZE + i] = INF;
	for (i = TSIZE - 1; i >= 1; i--)
	{
		tree[i] = min(tree[i << 1], tree[(i << 1) | 1]);
	}
	vector <bool> used(n, 0);
	vector <int> res(n);
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < n; j++)
		{
			if (used[j]) continue;
			if (Get(1, j, 0, TSIZE - 1) == 0)
			{
				if (GetMin(1, 0, j - k, 0, TSIZE - 1) > 0)
				{
					used[j] = 1;
					res[i] = j + 1;
					Add(1, -1, 0, j - k, 0, TSIZE - 1);
					Add(1, 1 << 20, j, j, 0, TSIZE - 1);
					break;
				}
			}
        }
	}
	for (i = 0; i < res.size(); i++)
		cout << res[i] << " ";

}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("in", "rt", stdin);
	freopen("out", "wt", stdout);
#endif
	Load();
	Solve();
	return 0;
}
